/**
 * @description 角色和权限中间表
 */
const dayjs = require("dayjs");
const mongoose = require("../db/db");
// 定义Schema
const Schema = mongoose.Schema({
    createDate: {
        type: Number,
        default: dayjs()
    },
    role_id: {
        type: String,
        require: true
    },
    menu_id: {
        type: String,
        require: true
    },
    permissionMark:{
        type:String,
        require:true,
    }
},)

// 创建唯一索引
Schema.index({ role_id: 1, menu_id: 1 }, { unique: true });
// 创建Model

const mode = mongoose.model("role_permission_link", Schema);
module.exports = mode;